import java.util.Arrays;

public class TestMain {
    public static void main(String[] args) {
        Solution s = new Solution();

        int[] fruits = {0,1,2,2};
        System.out.println(s.totalFruit(fruits));

        fruits = new int[]{1,2,1};
        System.out.println(s.totalFruit(fruits));

        fruits = new int[]{1,2,3,2,2};
        System.out.println(s.totalFruit(fruits));

        fruits = new int[]{3,3,3,1,2,1,1,2,3,3,4};
        System.out.println(s.totalFruit(fruits));

        fruits = new int[]{0};
        System.out.println(s.totalFruit(fruits));

        fruits = new int[]{0,0,1,1};
        System.out.println(s.totalFruit(fruits));

        fruits = new int[]{1,0,1,4,1,4,1,2,3};
        System.out.println(s.totalFruit(fruits));
    }
}
